fix: hardening batch from adversarial code review (v3.7.6) - #124
Merged
Conversation
Address findings from a full adversarial review of the vault store, mesh, guard/enforcement layer, provisioning, and CLI/cron paths. All fixes; no API breaks. NoteFields gains backward-compatible frontmatter/lead fields. Data integrity: - Preserve YAML frontmatter + lead prose through parse/render and the mesh merge; fence-aware section splitting; symmetric equal-rev merge convergence. - errors="replace" (+ BOM strip) on every note/index/log read so one bad byte can't down listing/search/writes; search/backlinks skip a mid-scan delete. - Case-insensitive reserved-name check; reject dot-prefixed/over-long titles; close the create_note concurrent-create race; atomic dir-fsynced writes. Guard false-positives + crash-hardening: - Freshness accepts `git -C <repo> fetch` and `git fetch && git status`. - Command-anchor the forge/destructive seed rules; a bare `>` (pytest 2>&1) is no longer a side effect; resolve global-config paths against $HOME so a project-local .claude/ isn't gated; negation-aware auth detection. - Reject uncompilable/empty-match learned rules at load and skip them at match time so one bad rule can't brick every tool call; wrapper/sudoedit command-position coverage. Enforcement fail-open holes: - Adapter fails CLOSED on unparseable events and reads array-shaped args; contentless list-notes/graph-* no longer clears the gate; secret-output guard no longer leaks `pass show X 2>/dev/null | head` nor false-blocks `pass` inside a word; turn-reset clears pending/freshness (per-turn again). Availability: - Atomic config/hook/backup writes (a torn write can't brick a harness or the guard hook). Checkpoint never raises into the timer + absolute ExecStart. - Mesh: gitignore .obsidian/workspace.json, doctor surfaces per-peer sync errors, push timeout no longer aborts the pass, BatchMode git. - Self-update: OMIND_NO_UPDATE_CHECK no longer disables an explicit update; install/check timeouts. lint --strict passes on a healthy vault. Migrate hook migrates before deleting (no fuzzy/slug-less data loss). Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
| try: | ||
| if src.isatty(): # a by-hand invocation with no piped event: nothing to guard | ||
| return 0 | ||
| except (AttributeError, ValueError, OSError): |
This was referenced Jul 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
A hardening batch addressing findings from a full adversarial code review of the vault store, mesh replication, guard/enforcement layer, provisioning, and CLI/cron paths. All fixes — no API breaks.
NoteFieldsgains backward-compatiblefrontmatter/leadfields. Version bumped 3.7.5 → 3.7.6 (patch, per SemVer discipline) with a CHANGELOG entry.Highlights
create_noteconcurrent-create race closed; atomic writes fsync the directory.errors="replace"(+ BOM strip); search/backlinks skip a note deleted mid-scan.git -C <repo> fetchand compound read forms; forge/destructive rules are command-anchored; a bare>(pytest 2>&1) is no longer a "side effect"; global-config paths resolve against$HOMEso a project-local.claude/isn't gated; negation-aware auth detection.sudoedit.args; contentlesslist-notes/graph-*no longer clears the gate; secret-output guard no longer leakspass show X 2>/dev/null | headnor false-blockspassinside a word; turn-reset clears pending/freshness.ExecStart; mesh gitignores.obsidian/workspace.json, doctor surfaces per-peer sync errors, a push timeout no longer aborts the whole pass;OMIND_NO_UPDATE_CHECKno longer breaks explicit self-update;lint --strictpasses on a healthy vault; the migrate hook migrates before deleting (no fuzzy/slug-less data loss).Test plan
pytest— 714 passed, 1 skipped (the skip is the platform-gated bash+jq secret-guard suite).ruff check .— clean.mypy src— clean.pyproject.toml=__init__.py=uv.lock=3.7.6;uv lock --checkresolves.🤖 Generated with Claude Code
Proudly Made in Nebraska. Go Big Red! 🌽 https://xkcd.com/2347/